<div class="frame_introDiv">
<form name="courtForm" id="courtForm" action="adminb-court-joinjury?itemid=<?=$this->itemArray[0]['itemid']?>" enctype="multipart/form-data"  method="post">
  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">
    <tr>
      <td width="20%" class="ri-bbgg"> Case name</td>
      <td width="80%" class="le">
	  	<?=$this->itemArray[0]['subject']?>
	  	<?if($this->itemArray[0]['flid']=='3'):?>
			<br /><a target="_blank" href="court?itemid=<?=$this->itemArray[0]['itemid']?>">Case is in trial, click and enter to view the trial process</a>
		<?endif;?>
	  </td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Complainant name</td>
      <td class="le"><?=$this->complainant_username?></td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Defendant name</td>
      <td class="le"><?=$this->defendant_username?></td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Winer</td>
      <td class="le">
		<?if($this->itemArray[0]['win_uid']==$this->itemArray[0]['complainant_uid']):?>
			<?=$this->complainant_username?>
		<?elseif($this->itemArray[0]['win_uid']==$this->itemArray[0]['defendant_uid']):?>
			<?=$this->defendant_username?>
		<?else:?>
			No winner temporarily
		<?endif;?>
	  </td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Case description</td>
      <td class="le">
	  	<?=$this->itemArray[0]['case_intro']?>
	  </td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Complainant material</td>
      <td class="le">
	  	<?if($this->itemArray[0]['complainant_content']!=''):?>
	  	<div><?=$this->subStr($this->toText($this->itemArray[0]['complainant_content']),0,30)?></div>
		<div><a target="blank" href="adminb-court-prosecution?itemid=<?=$this->itemArray[0]['itemid']?>">Check it</a></div>
		<?else:?>
		No material temporarily
		<?endif;?>
	  </td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Defendant material</td>
      <td class="le">
	  	<?if($this->itemArray[0]['defendant_content']!=''):?>
	  	<div><?=$this->subStr($this->toText($this->itemArray[0]['defendant_content']),0,30)?></div>
		<div><a target="blank" href="adminb-court-prosecution?itemid=<?=$this->itemArray[0]['itemid']?>">Check it</a></div>
		<?else:?>
		No material temporarily
		<?endif;?>
	  </td>
    </tr>
	<tr>
      <td class="ri-bbgg"> Case conclusion</td>
      <td class="le">
	  	<?if($this->itemArray[0]['conclusion']!=''):?>
	  	<div><?=$this->subStr($this->toText($this->itemArray[0]['conclusion']),0,50)?></div>
		<div><a target="blank" href="adminb-court-conclusion?itemid=<?=$this->itemArray[0]['itemid']?>">Check it</a></div>
		<?else:?>
		No conclusion temporarily
		<?endif;?>
	  </td>
    </tr>
	<tr>
      <td class="ri-bbgg"> The link of the products in question</td>
	  <td class="le">
	  	<?if($this->itemArray[0]['product_url']!=''):?>
	  		<a href="<?=$this->itemArray[0]['product_url']?>" target="_blank"><?=$this->itemArray[0]['product_url']?></a>
		<?else:?>
			No url temporarily
		<?endif;?>
	  </td> 
	</tr>
	<tr>
      <td class="ri-bbgg"> The time of the trial(Beijing time)</td>
	  <td class="le">
	  	<?if($this->itemArray[0]['judge_time']=='0'):?>
			Not yet determined the time of the trial
		<?else:?>
	   		<?=date('Y-m-d H:i:s',$this->itemArray[0]['judge_time'])?>
		<?endif;?>
	  </td> 
    </tr>
	<tr>
      <td class="ri-bbgg"> Judge time(Beijing time)</td>
	  <td class="le">
	  	<?if($this->itemArray[0]['sentence_time']=='0'):?>
			Not yet to determine the judge time
		<?else:?>
	   		<?=date('Y-m-d H:i:s',$this->itemArray[0]['sentence_time'])?>
		<?endif;?>
	  </td> 
    </tr>
	<tr>
      <td class="ri-bbgg"> Case state</td>
	  <td class="le">
	   <?=$this->itemArray[0]['flname']?>
	  </td> 
    </tr>
	<?if($this->itemArray[0]['flid']=='1'):?>
	<tr>
	  <td class="ri-bbgg"> Jury</td>
	  <td class="le">
	  	<?if(count($this->juryArray)==0):?>
			<?if($this->itemArray[0]['uid']!=$this->uid&&$this->itemArray[0]['defendant_uid']!=$this->uid):?>
				<div>Apply to become a juror, please fill out the reason：</div>
				<div><textarea name="reason" style="width:400px;height:80px;margin:10px"></textarea></div>
				<div><input type="button" value="Apply" onclick="joinJury();" /></div>
			<?else:?>
				You can't be a jury
			<?endif;?>
		<?else:?>
			You have applied for being a juror! Please wait for administrator review！
		<?endif;?>
	  </td> 
	</tr>
	<?elseif(count($this->juryArray)>0):?>
	<tr>
	  <td class="ri-bbgg"> Jury</td>
	  <td class="le">
	  	<div>You are the juror in this case</div>
		<div>The reason you apply for jury：<?=$this->juryArray[0]['reason']?></div>
		<div>Your comment on the case：<?=$this->juryArray[0]['comment']?></div>
	  </td> 
	</tr>	
	<?endif;?>
  </table>
  </form>
</div>
<script>
$('input[name="win_uid"]').each(
	function(){
		if($(this).val()=='<?=$this->itemArray[0]['win_uid']?>'){
			$(this).attr('checked',true);
		}
	}
);
function joinJury(){
	var reason=$('textarea[name="reason"]').val();
	if(trim(reason)==''){
		alert("Please fill in the reasons for applying for being a juror！");
		return false;
	}
	$('#courtForm').submit();
}
</script>